﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ThridGroup.ERP.DTO.ProductionSystem.ShiftSchedulingManagement.Procurement;
using ThridGroup.ERP.DTO.WarehouseManagement;
using Volo.Abp.Application.Services;

namespace ThridGroup.ERP.WarehouseManagement
{
    /// <summary>
    /// 采购入库查询结果
    /// </summary>
    public class ProcurementQueryResult
    {
        /// <summary>
        /// 数据列表
        /// </summary>
        public List<ProcurementDto> Data { get; set; } = new List<ProcurementDto>();
        
        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }
    }

    /// <summary>
    /// 采购入库接口
    /// </summary>
    public interface IProcurementServices : IApplicationService
    {
        /// <summary>
        /// 添加采购入库
        /// </summary>
        /// <param name="dto">采购入库信息</param>
        /// <returns></returns>
        Task<int> CreateProcurement(ProcurementDto dto);

        /// <summary>
        /// 查询采购入库（分页/条件）
        /// </summary>
        /// <param name="dto">查询条件</param>
        /// <returns></returns>
        Task<ProcurementQueryResult> QueryProcurement(GetProcurementDto dto);

        /// <summary>
        /// 修改采购入库
        /// </summary>
        /// <param name="dto">采购入库信息</param>
        /// <returns></returns>
        Task<int> UpdateProcurement(ProcurementDto dto);

        /// <summary>
        /// 批量删除采购入库
        /// </summary>
        /// <param name="ids">采购入库ID列表</param>
        /// <returns></returns>
        Task BatchDeleteProcurement(List<int> ids);

        /// <summary>
        /// 根据ID获取采购入库信息
        /// </summary>
        /// <param name="id">采购入库ID</param>
        /// <returns></returns>
        Task<ProcurementDto> GetProcurementById(int id);

        /// <summary>
        /// 根据ID获取采购入库信息修改入库状态
        /// </summary>
        /// <param name="id">采购入库ID</param>
        /// <returns></returns>
        Task<int> GetProcurementStatus(int id);

        // ================== 物料入库增删改查 ==================
        Task<int> CreateMaterialReceiptLine(MaterialReceiptLineDto dto);
        Task<MaterialReceiptLineQueryResult> QueryMaterialReceiptLine(string lnboundCode, int page = 1, int limit = 10);
        Task<int> UpdateMaterialReceiptLine(MaterialReceiptLineDto dto);
        Task BatchDeleteMaterialReceiptLine(List<int> ids);
        Task<MaterialReceiptLineDto> GetMaterialReceiptLineById(int id);
    }
}
